﻿using Autofac;
using Autofac.Extras.DynamicProxy;
using System;
using System.Collections.Generic;
using System.Text;
using Truron.Purchase.Interface;
using Truron.Purchase.Model;

namespace Truron.Purchase.Service
{
    /// <summary>
    /// autofac  IOC依赖注入
    /// </summary>
    public class CustomAutofacModule : Autofac.Module
    {
        protected override void Load(ContainerBuilder builder)
        {
            //builder.Register(c => new CustomAutofacAop());//aop注册
            builder.RegisterType<Purchase_OuterNoteService>().As<IPurchase_OuterNoteService>().SingleInstance();
            builder.RegisterType<Purchase_SupplyAreaService>().As<IPurchase_SupplyAreaService>().SingleInstance();
            builder.RegisterType<Purchase_CategoryService>().As<IPurchase_CategoryService>().SingleInstance();
            builder.RegisterType<Purchase_SupplyService>().As<IPurchase_SupplyService>().SingleInstance();
            builder.RegisterType<Purchase_OuterRequestService>().As<IPurchase_OuterRequestService>().SingleInstance();
            builder.RegisterType<FlowInstanceService>().As<IFlowInstanceService>().SingleInstance();
            builder.RegisterType<Purchase_OuterRequestApprovalService>().As<IPurchase_OuterRequestApprovalService>().SingleInstance();
            builder.RegisterType<Purchase_OuterRequestDetailService>().As<IPurchase_OuterRequestDetailService>().SingleInstance();
            builder.RegisterType<Purchase_OuterRequestNoteRelationService>().As<IPurchase_OuterRequestNoteRelationService>().SingleInstance();
            builder.RegisterType<Purchase_OuterNoteApprovalService>().As<IPurchase_OuterNoteApprovalService>().SingleInstance();
            builder.RegisterType<Purchase_FileInfoService>().As<IPurchase_FileInfoService>().SingleInstance();
            builder.RegisterType<Purchase_LeftGroupService>().As<IPurchase_LeftGroupService>().SingleInstance();
            builder.RegisterType<Purchase_TestService>().As<IPurchase_TestService>().SingleInstance();
            builder.RegisterType<Purchase_OuterRequestDetailApprovalService>().As<IPurchase_OuterRequestDetailApprovalService>().SingleInstance();
            builder.RegisterType<Purchase_OuterNoteDetailService>().As<IPurchase_OuterNoteDetailService>().SingleInstance();
            builder.RegisterType<Purchase_DataSourceService>().As<IPurchase_DataSourceService>().SingleInstance();
            builder.RegisterType<Purchase_OuterNotePayRelationService>().As<IPurchase_OuterNotePayRelationService>().SingleInstance();
            builder.RegisterType<Purchase_OuterNoteInvoiceRelationService>().As<IPurchase_OuterNoteInvoiceRelationService>().SingleInstance();
        }
    }
}
